package com.cskaoyan.filter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author stone
 * @date 2022/08/09 09:57
 */
public class CustomFilter extends OncePerRequestFilter {


    @Override
    protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
        // 之前你在Filter的实现类里写什么 → 你在OncePerRequestFilter的子类里写什么
        System.out.println("松哥牛皮");
        filterChain.doFilter(httpServletRequest,httpServletResponse);
    }
}
